﻿using GWB.Core.TableEntity.Common;
using SqlSugar;
using System;

namespace GWB.Core.TableEntity
{
    [SugarTable("GWB_RequestLog")]
    public class RequestLog
    {
        /// <summary>
        /// Id
        /// </summary>
        [SugarColumn(ColumnDataType = "bigint", IsPrimaryKey = true, ColumnDescription = "主键", IsNullable = false, IsIdentity = true)]
        public long Id { get; set; }
        /// <summary>
        /// ip
        /// </summary>
        [SugarColumn(ColumnDataType = "varchar(20)", ColumnDescription = "ip", IsNullable = true)]
        public string Ip { get; set; }

        /// <summary>
        /// 请求方式
        /// </summary>
        [SugarColumn(ColumnDataType = "varchar(10)", ColumnDescription = "请求方式", IsNullable = true)]
        public string Method { get; set; }

        /// <summary>
        /// 请求地址
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar(300)", ColumnDescription = "请求地址", IsNullable = true)]
        public string RequestUrl { get; set; }

        /// <summary>
        /// 来源地址
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar(300)", ColumnDescription = "来源地址", IsNullable = true)]
        public string RefererUrl { get; set; }

        /// <summary>
        /// 请求参数
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar(max)", ColumnDescription = "请求参数", IsNullable = true)]
        public string Parameters { get; set; }

        /// <summary>
        /// 返回结果
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar(max)", ColumnDescription = "返回结果", IsNullable = true)]
        public string ReturnResult { get; set; }


        /// <summary>
        /// 是否Error
        /// </summary>
        [SugarColumn(ColumnDataType = "bit", ColumnDescription = "是否Error", IsNullable = false)]
        public bool IsError { get; set; }

        /// <summary>
        /// 操作说明
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar(100)", ColumnDescription = "操作说明", IsNullable = false)]
        public string Annotation { get; set; }

        [SugarColumn(ColumnDataType = "decimal(18,2)", ColumnDescription = "消耗的时间", IsNullable = false)]
        public decimal ConsumedTime { get; set; }

        /// <summary>
        ///(租户Id)
        /// </summary>
        [SugarColumn(ColumnDataType = "bigint", ColumnDescription = "集团Id(租户Id)", IsNullable = false)]
        public long TenantId { get; set; }

        /// <summary>
        /// 组织Id
        /// </summary>
        [SugarColumn(ColumnDataType = "bigint", ColumnDescription = "组织Id", IsNullable = false)]
        public long OrgId { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(ColumnDataType = "datetime", ColumnDescription = "创建时间", IsNullable = false)]
        public DateTime CreateAt { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        [SugarColumn(ColumnDataType = "varchar(50)", ColumnDescription = "创建人", IsNullable = true)]
        public string CreateBy { get; set; }
    }
}
